package com.core.zyyz.amc.modules.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.core.zyyz.amc.modules.mapper.AmcBusinessCategoriesMapper;
import com.core.zyyz.amc.modules.domain.AmcBusinessCategories;
import com.core.zyyz.amc.modules.service.AmcBusinessCategoriesService;

/**
 * 项目类型维护Service业务层处理
 *
 * @author LiuFushun
 * @date 2024-11-04
 */
@Service
public class AmcBusinessCategoriesServiceImpl implements AmcBusinessCategoriesService
{
    @Autowired
    private AmcBusinessCategoriesMapper amcBusinessCategoriesMapper;

    /**
     * 查询项目类型维护
     *
     * @param bizId 项目类型维护主键
     * @return 项目类型维护
     */
    @Override
    public AmcBusinessCategories selectAmcBusinessCategoriesByBizId(String bizId)
    {
        return amcBusinessCategoriesMapper.selectAmcBusinessCategoriesByBizId(bizId);
    }

    /**
     * 查询项目类型维护列表
     *
     * @param amcBusinessCategories 项目类型维护
     * @return 项目类型维护
     */
    @Override
    public List<AmcBusinessCategories> selectAmcBusinessCategoriesList(AmcBusinessCategories amcBusinessCategories)
    {
        return amcBusinessCategoriesMapper.selectAmcBusinessCategoriesList(amcBusinessCategories);
    }

    /**
     * 新增项目类型维护
     *
     * @param amcBusinessCategories 项目类型维护
     * @return 结果
     */
    @Override
    public int insertAmcBusinessCategories(AmcBusinessCategories amcBusinessCategories)
    {
        amcBusinessCategories.setBizId(UUID.randomUUID().toString());
        return amcBusinessCategoriesMapper.insertAmcBusinessCategories(amcBusinessCategories);
    }

    /**
     * 修改项目类型维护
     *
     * @param amcBusinessCategories 项目类型维护
     * @return 结果
     */
    @Override
    public int updateAmcBusinessCategories(AmcBusinessCategories amcBusinessCategories)
    {
        return amcBusinessCategoriesMapper.updateAmcBusinessCategories(amcBusinessCategories);
    }

    /**
     * 批量删除项目类型维护
     *
     * @param bizIds 需要删除的项目类型维护主键
     * @return 结果
     */
    @Override
    public int deleteAmcBusinessCategoriesByBizIds(String[] bizIds)
    {
        return amcBusinessCategoriesMapper.deleteAmcBusinessCategoriesByBizIds(bizIds);
    }

    /**
     * 删除项目类型维护信息
     *
     * @param bizId 项目类型维护主键
     * @return 结果
     */
    @Override
    public int deleteAmcBusinessCategoriesByBizId(String bizId)
    {
        return amcBusinessCategoriesMapper.deleteAmcBusinessCategoriesByBizId(bizId);
    }

    /**
     * 根据子流程节点id查看关联的节点列表
     * @param subnodeId
     * @return
     */
    @Override
    public List<HashMap<String, Object>> getCategoriesMapBySubnodeId(String subnodeId) {
        return amcBusinessCategoriesMapper.getCategoriesMapBySubnodeId(subnodeId);
    }

    /**
     * 查看是否存在已关联的节点
     * @param hashp
     * @return
     */
    @Override
    public int getMappingCount(Map<String, Object> hashp) {
        return amcBusinessCategoriesMapper.getMappingCount(hashp);
    }

    /**
     * 添加关联节点
     * @param paramMap
     * @return
     */
    @Override
    public int addCategoriesNode(Map<String, Object> paramMap) {
        return amcBusinessCategoriesMapper.addCategoriesNode(paramMap);
    }

    /**
     * 查询项目节点定义
     * @param bizId
     * @return
     */
    @Override
    public List<HashMap<String ,Object>> queryCategoriesMapping(String bizId) {
        return amcBusinessCategoriesMapper.queryCategoriesMapping(bizId);
    }

    /**
     * 根据项目类型id BIZ_ID和子流程节点idsubnode_id删除关联节点
     * @param hashMap
     * @return
     */
    @Override
    public int deleteCategoriesNodeById(HashMap<String, Object> hashMap) {
        return amcBusinessCategoriesMapper.deleteCategoriesNodeById(hashMap);
    }
}
